package com.endava.action;


import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Enumeration;

public class LoginAction extends HttpServlet {

	private static final long serialVersionUID = 4237821168842623134L;

	public void doPost(HttpServletRequest req, HttpServletResponse resp) {

        String username = req.getParameter("username");
        //get Init Parameters
        System.out.println("------Init Parameters----------");
        String adminEmail = getServletConfig().getInitParameter("adminEmail");
        System.out.println("Admin Email: " + adminEmail);

        Enumeration initParameters = getServletConfig().getInitParameterNames();
        while (initParameters.hasMoreElements()) {
            String name = (String) initParameters.nextElement();
            System.out.println("Name: " + name + " Value: " + getServletConfig().getInitParameter(name));
        }

        //context init parameters
        System.out.println("------Context Init Parameters----------");
        String storeName = getServletContext().getInitParameter("storeName");
        System.out.println("Store name: " + storeName);
    }
}
